﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ComponentModel;
using System.Xml.Serialization;

namespace Wordpress.Phone.Models
{
    public class Thumbnail : INotifyPropertyChanged
    {

        private Uri _source;

        [XmlIgnore]
        public Uri Source
        {
            get
            {
                return this._source;
            }
            set
            {
                if (value != this._source) {
                    this._source = value;
                    this.OnNotifyPropertyChanged("Source");
                }
            }
        }

        public string SourceString
        {
            get
            {
                return this.Source.ToString();
            }
            set
            {
                this.Source = new Uri(value);
            }
        }

        public int Width { get; set; }

        public int Height { get; set; }

        #region INotifyPropertyChanged

        public event PropertyChangedEventHandler PropertyChanged;

        protected void OnNotifyPropertyChanged(string propName)
        {
            if (this.PropertyChanged != null)
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propName));
            }
        }

        #endregion
    }
}
